import getlink from "@/api/getapi.js"

let userm = {
  state: {
    arr: []
  },
  mutations: {
    updata(state, payload) {
      state.arr = payload.arrdata
    }
  },
  actions: {
    getdata(context, payload) {
      getlink(payload.url).then((ok) => {
        context.commit("updata", { arrdata: ok.data.data })
        console.log(ok.data.data);
      })
    }
  },

  getters: {
    contentarr1(state) {
      return state.arr.slice(0, 3);
    },
    contentarr2(state) {
      return state.arr.slice(3, 5);
    },
    contentarr3(state) {
      return state.arr.slice(5, 6);
    },
  },
}
export default userm